WAF: Ensure that non-set $_SERVER['REQUEST_METHOD'] is treated the same as CLI in the sense that the WAF is skipped.#49465
Conversation
… as CLI in the sense that the WAF is skipped.
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
…onments. Ensure the tests always clean up after themselves.
Supersedes #49458
Proposed changes
$_SERVER['REQUEST_METHOD']is empty, treating any non-HTTP context the same as CLI (PHP_SAPIcli).testRunSkipsRulesWhenRequestMethodIsAbsent) verifying thatWaf_Runner::run()starts but returns early without including the rules file when no request method is present.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
CI should cover it.